package com.example.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.config.R;
import com.example.domain.Member;
import com.example.mapper.MemberMapper;
import com.example.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 会员Service业务层处理
 *
 * @author ruoyi
 * @date 2022-11-22
 */
@Service
public class MemberServiceImpl implements IMemberService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public R getMember(Long dealerId) {
        LambdaQueryWrapper<Member> lqw = new LambdaQueryWrapper<>();
        lqw.eq(Member::getDealerId, dealerId);
        Member member = memberMapper.selectOne(lqw);
        if (member == null)
            return R.fail("没有会员");
        return R.ok(member);
    }


}
